{% extends 'base.html' %}
{% block title %}Docker私有仓库{% endblock %}

{% block content %}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                {% block main %}
                    <h2>{% block title1 %}
                    Docker私有仓库
                    {% endblock %}
                        <div class="btn-group pull-right">
                            <a class="btn btn-info" href="/docker/registry_add/" target="_blank" title="添加仓库"><span class="glyphicon glyphicon-plus"></span> 添加仓库</a>
                        </div>
                    </h2>
                    {% if error %}<div class="alert alert-danger"><a href="#" class="close" data-dismiss="alert">&times;</a>{{ error }}</div>{% endif %}
                    {% if success %}<div class="alert alert-success"><a href="#" class="close" data-dismiss="alert">&times;</a>{{ success }}</div>{% endif %}

                    <div class="row">
                        <div class="col-sm-12 col-md-12">
                            <div class="table-responsive">
                            {% block table %}
                                <table class="table table-hover table-bordered table-striped">
                                    <thead>
                                        <tr>
                                            <th>私有仓库名称</th>
                                            <th>私有仓库地址</th>
                                            <th>私有仓库版本</th>
                                            <th>私有仓库状态</th>
                                            <th>操作管理</th>
                                        </tr>
                                    </thead>
                                    {% for reg in reg_list %}
                                            <tbody>
                                                <tr>
                                                    <td>{{ reg.name }}</td>
                                                    <td><a href="/docker/registry_image/{{ reg.id }}/" title="/docker/registry_image/{{ reg.id }}/">{{ reg.address }}</a></td>
                                                    <td><small class="navbar-btn" >V{{ reg.version }}</small></td>
                                                    <td>{% if reg.status  == 0 %}
                                                            <small style="color: green" > Healthy</small>
                                                        {% else %}
                                                            <small style="color: red" > UnHealthy</small>
                                                        {% endif %}</td>
                                                    <td>
                                                        <div class="btn-group">
                                                            <a class="btn btn-info btn-xs" href="/docker/registry_del/?reg_id={{ reg.id }}">
                                                                <span class="glyphicon glyphicon-edit ">&nbsp;删除</span></a>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        {% endfor %}
                                </table>
                                {% endblock %}
                            </div>
                        </div>
                    </div>
                {% endblock %}
            </div>
        </div>
    </div>
{% endblock %}